package com.neusoft.mapper;

import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.neusoft.po.BVirtualWallet;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.nio.charset.CodingErrorAction;

@Mapper
public interface BVirtualWalletMapper {

    //更新金额
    @Update("update bvirtualwallet set balance=#{balance} where businessId= #{businessId}")
    public int updateBVirtualwallet(Integer businessId, BigDecimal balance);


    //新建一个钱包
    @Insert("insert into bvirtualwallet (businessId,balance) values (#{businessId},0)")
    public int saveBVirtualWallet(Integer businessId);

    //查询一个钱包
    @Select("select * from bvirtualwallet where businessId=#{businessId}")
    public BVirtualWallet getBVirtualWalletByBusinessId(Integer businessId);

}
